import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("输入一个正数：");
        int n = scanner.nextInt();
        System.out.println("斐波那契数列的第" + n + "项为：" + Fib(n));
    }

    public static int Fib(int n){
        int fib = 0;
        if (n == 1){
            fib = 0;
        }
        else if (n == 2 || n == 3){
            fib = 1;
        }else {
            fib = Fib(n - 1) + Fib(n - 2);
        }
        return fib;
    }
}


